package cn.jobstart.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.web.bind.annotation.RestController;
import cn.jobstart.pubInter.exception.SkException;
import cn.jobstart.pubInter.IBaseService;
import cn.jobstart.pubInter.RestfulController;
import cn.jobstart.dto.AdminJobRemarkDTO;
import cn.jobstart.dto.AdminJobRemarkPageDTO;
import cn.jobstart.modelExt.AdminJobRemarkExt;
import cn.jobstart.searchExt.AdminJobRemarkSearchExt;
import cn.jobstart.service.IAdminJobRemarkService;
import cn.jobstart.vo.AdminJobRemarkDetailVO;
import cn.jobstart.vo.AdminJobRemarkListVO;
import cn.jobstart.vo.AdminJobRemarkDomainVO;
import cn.jobstart.vo.AdminJobRemarkDetailDomainVO;
import cn.jobstart.export.AdminJobRemarkDomainExport;
import cn.jobstart.controller.ApiManageController;
import org.springframework.validation.annotation.Validated;
import java.util.Set;
import java.util.HashSet;
import cn.jobstart.pubInter.exception.BusinessException;

/**
*    @author sunke
*    @Date 2023-09-25 00:36:47
*    @description AdminJobRemarkController      员工职位备注
*/
@Api(tags = "后台管理系统-员工职位备注相关", description = "员工职位备注相关接口")
@RestController(value ="adminJobRemarkRestfulController")
@RequestMapping("/adminJobRemark/")
@Validated
public class AdminJobRemarkController extends ApiManageController<AdminJobRemarkDTO,AdminJobRemarkPageDTO,AdminJobRemarkExt, AdminJobRemarkSearchExt,AdminJobRemarkDomainVO,AdminJobRemarkDetailDomainVO,AdminJobRemarkDetailVO,AdminJobRemarkListVO,String> {

	@Resource(name = "adminJobRemarkService")
	private IAdminJobRemarkService adminJobRemarkService;


	@Override
	public boolean beforePostAdd(AdminJobRemarkDTO dto, AdminJobRemarkExt domain, HttpServletRequest request, HttpSession session) throws SkException {

		domain.setAdminId(getJwtsUtil().getAdminId(request));
		domain.setAdminTruename(getJwtsUtil().getAdminTruename(request));
		return super.beforePostAdd(dto, domain, request, session);
	}

	@Override
	public IBaseService<AdminJobRemarkExt, AdminJobRemarkSearchExt,String> getBaseService() throws SkException {
		return adminJobRemarkService;
	}

	@Override
	public String getBaseRoute() {
		return "/adminJobRemark/";
	}

	/**
	* 当前模板名称
	* @return
	*/
	@Override
	public String getModelName(){
		return "员工职位备注";
	}

	@Override
	public Class exportExcelClass() {
		return AdminJobRemarkDomainExport.class;
	}

	@Override
	public Set<String> totalMapSet() {
		Set totalMapSet=new HashSet();
		totalMapSet.add("count(admin_job_remark.ajr_id) as countNum");
		return totalMapSet;
	}


}